-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Per-World Home Limits #5601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.x
Are you sure you want to change the base?
Per-World Home Limits #5601
Conversation
…corporating world limit homes and world group home limits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, sorry this got lost in the queue. i requested a few changes and think we can simplify the approach to the config. after my review is addressed i will try to get this merged in asap.
throw new TranslatableException("noPerm", "essentials.worlds." + loc.getWorld().getName()); | ||
} | ||
if(!isUserHomeInWorldOrWorldGroupWorld(user.getWorld().getName(), Objects.requireNonNull(loc.getWorld()).getName())) { | ||
throw new Exception(tl("teleportNotPossible")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use TranslatableException here:
throw new TranslatableException("teleportNotPossible");
# When home-limit-per-world is enabled, with configuration sethome-multiple whichever setting has a number higher, | ||
# it then will be used | ||
# e.g. if sethome-multiple.vip is 5 and user has permission for this, and user is in world named world_the_end which | ||
# limit for home is 2, then user will have limit of higher number, therefore 5 homes in that world. | ||
# To not follow this logic, please remove user permission for that 'home rank'. | ||
# If world is not present in this configuration, configuration sethome-multiple.default | ||
# will be used as a home limit for that world. | ||
homes-per-world: | ||
world: 5 | ||
world_the_end: 2 | ||
|
||
# For this configuration, previous configuration home-limit-per-world needs to be enabled. | ||
# This allows you to create 'world groups' which can consist of how many worlds you want | ||
# and set limit for these worlds, then they will act as one world with their limit. | ||
# e.g. 'world group' named player-worlds which has worlds 'world' and 'world_nether' | ||
# which home limit is set to 4. User will have maximum of 4 homes in these worlds total. | ||
# If world is not present in this configuration, configuration sethome-multiple.default | ||
# will be used as a home limit for that world. | ||
home-limit-per-world-group: false | ||
|
||
# Name of the world group can be any english letter with spaces that are - | ||
# Worlds are split by a colon without spaces, as shown in the example: world,world_nether . | ||
# Worlds in a 'world group' act as one world. | ||
homes-per-world-group: | ||
player-worlds: | ||
worlds: world,world_nether | ||
home-limit: 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think these config options should instead be:
home-limit-per-world: false
sethome-world-multiple:
default:
world: 5
world_the_nether: 10
vip:
world: 10
world_the_nether: 20
this way we can minimize confusion and let people configure it all under one setting, people who don't want to do by group can just use default
final int limit = ess.getSettings().getHomeLimit(user); | ||
if (usersHome.getHomes().size() >= limit) { | ||
final List<String> homes = usersHome.isReachable() ? | ||
usersHome.getHomesPerWorld(Objects.requireNonNull(usersHome.getLocation().getWorld()).getName()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we get the limit for user
not usersHome`?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, sorry this got lost in the queue. i requested a few changes and think we can simplify the approach to the config. after my review is addressed i will try to get this merged in asap.
Closes #2393